<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserAddressTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_address', function (Blueprint $table) {
            $table ->bigIncrements('id') ->comment('用户地址表');
            $table ->integer('user_id') ->default(0) ->comment('用户id');
            $table ->string('prov',20) ->nullable() ->comment('省份');
            $table ->string('city',20) ->nullable() ->comment('城市');
            $table ->string('country',20) ->nullable() ->comment('乡/县');
            $table ->string('town',20) ->nullable() ->comment('镇');
            $table ->string('village',20) ->nullable() ->comment('村');
            $table ->timestamps();
            $table ->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('user_address', function (Blueprint $table) {
            //
        });
    }
}
